function rest = randucousqdt(t,~,T,a,b,m,sig0,betaK,s,IIpart)


sigmavalue=[s.sigma0(t,T,a,m,sig0),...
    s.sigma1(t,T,a,b),s.sigma2(t,T,a,b),s.sigma3(t,T,a,b),s.sigma4(t,T,a,b),s.sigma5(t,T,a,b),...
    s.sigma6(t,T,a,b),s.sigma7(t,T,a,b),s.sigma8(t,T,a,b),s.sigma9(t,T,a,b),s.sigma10(t,T,a,b),...
    s.sigma11(t,T,a,b),s.sigma12(t,T,a,b),s.sigma13(t,T,a,b),s.sigma14(t,T,a,b),s.sigma15(t,T,a,b),...
    s.sigma16(t,T,a,b),s.sigma17(t,T,a,b),s.sigma18(t,T,a,b),s.sigma19(t,T,a,b),s.sigma20(t,T,a,b),...
    s.sigma21(t,T,a,b),s.sigma22(t,T,a,b),s.sigma23(t,T,a,b),s.sigma24(t,T,a,b),s.sigma25(t,T,a,b),...
    s.sigma26(t,T,a,b),s.sigma27(t,T,a,b),s.sigma28(t,T,a,b),s.sigma29(t,T,a,b),s.sigma30(t,T,a,b)];

rest=ones(1+2*betaK+betaK*(betaK-1)/2,1);
rest(1)=sum(sigmavalue(1:betaK+1).^2);
rest(2:betaK+1)=2*sigmavalue(1)*sigmavalue(2:betaK+1);
rest(betaK+2:2*betaK+1)=sqrt(2)*sigmavalue(2:betaK+1).^2;
base=2*betaK+1;
for ii=1:betaK
    index=find(IIpart(:,ii)==1);
    rest(base+index)=rest(base+index)*sigmavalue(ii+1);
end
rest(2*betaK+2:2*betaK+1+betaK*(betaK-1)/2)=2*rest(2*betaK+2:2*betaK+1+betaK*(betaK-1)/2);
